<?php
namespace BP\Sys\FrmUI;
require_once("BP/En/Map.php");
require_once("BP/Web/WebUser.php");
class FrmLink extends EntityMyPK {
	public function getFontStyle () 
	{
		return $this->GetValStringByKey(FrmLinkAttr::$FontStyle);
	}
	public function setFontStyle ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$FontStyle, $value);
	}
	public function getFontColorHtml () 
	{
		return PubClass::ToHtmlColor($this->getFontColor());
	}
	public function getFontColor () 
	{
		return $this->GetValStringByKey(FrmLinkAttr::$FontColor);
	}
	public function setFontColor ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$FontColor, $value);
	}
	public function getURL () 
	{
		return $this->GetValStringByKey(FrmLinkAttr::$URL)->replace("#", "@");
	}
	public function setURL ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$URL, $value);
	}
	public function getFontName () 
	{
		return $this->GetValStringByKey(FrmLinkAttr::$FontName);
	}
	public function setFontName ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$FontName, $value);
	}
	public function getY () 
	{
		return $this->GetValFloatByKey(FrmLinkAttr::$Y);
	}
	public function setY ($value) // [float value]
	{
		$this->SetValByKey(FrmLinkAttr::$Y, $value);
	}
	public function getX () 
	{
		return $this->GetValFloatByKey(FrmLinkAttr::$X);
	}
	public function setX ($value) // [float value]
	{
		$this->SetValByKey(FrmLinkAttr::$X, $value);
	}
	public function getFontSize () 
	{
		return $this->GetValIntByKey(FrmLinkAttr::$FontSize);
	}
	public function setFontSize ($value) // [int value]
	{
		$this->SetValByKey(FrmLinkAttr::$FontSize, $value);
	}
	public function getFK_MapData () 
	{
		return $this->GetValStrByKey(FrmLinkAttr::$FK_MapData);
	}
	public function setFK_MapData ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$FK_MapData, $value);
	}
	public function getText () 
	{
		return $this->GetValStrByKey(FrmLinkAttr::$Text);
	}
	public function setText ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$Text, $value);
	}
	public function getTarget () 
	{
		return $this->GetValStringByKey(FrmLinkAttr::$Target);
	}
	public function setTarget ($value) // [String value]
	{
		$this->SetValByKey(FrmLinkAttr::$Target, $value);
	}
	public function getIsBold () 
	{
		return $this->GetValBooleanByKey(FrmLabAttr::$IsBold);
	}
	public function setIsBold ($value) // [boolean value]
	{
		$this->SetValByKey(FrmLabAttr::$IsBold, $value);
	}
	public function getIsItalic () 
	{
		return $this->GetValBooleanByKey(FrmLabAttr::$IsItalic);
	}
	public function setIsItalic ($value) // [boolean value]
	{
		$this->SetValByKey(FrmLabAttr::$IsItalic, $value);
	}
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->Readonly();
		if ($WebUser->getNo()->equals("admin"))
		{
			$uac->IsUpdate =  TRUE ;
		}
		return $uac;
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public static function constructor__String ($mypk) // [String mypk]
	{
		$me = new self();
		$me->setMyPK($mypk);
		$me->Retrieve();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FrmLink", "超连�?");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->IndexField = MapAttrAttr::$FK_MapData;
		$map->AddMyPK();
		$map->AddTBString(FrmLinkAttr::$Target, "_blank", "连接目标(_blank,_parent,_self)",  TRUE ,  FALSE , 0, 20, 20);
		$map->AddTBString(FrmLinkAttr::$Text, "New Link", "标签",  TRUE ,  FALSE , 0, 500, 20,  TRUE );
		$map->AddTBString(FrmLinkAttr::$URL, NULL, "URL",  TRUE ,  FALSE , 0, 500, 20,  TRUE );
		$map->AddTBString(FrmLinkAttr::$FK_MapData, NULL, "表单ID",  FALSE ,  FALSE , 1, 100, 20);
		$map->AddDDLSQL(MapAttrAttr::$GroupID, 0, "显示的分�?", "SELECT OID as No, Lab as Name FROM Sys_GroupField WHERE FrmID='@FK_MapData' AND (CtrlType IS NULL OR CtrlType='')  ",  TRUE );
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	protected function afterInsertUpdateAction () 
	{
		$frmLink = FrmLink::constructor__();
		$frmLink->setMyPK($this->getMyPK());
		$frmLink->RetrieveFromDBSources();
		$frmLink->Update();
		CCFormAPI->AfterFrmEditAction($this->getFK_MapData());
		parent->afterInsertUpdateAction();
	}
	protected function afterDelete () 
	{
		CCFormAPI->AfterFrmEditAction($this->getFK_MapData());
		parent->afterDelete();
	}
}
?>
